﻿@using Newtonsoft.Json;
@{
    ViewBag.Title = "配件 | 大卫杜夫 | 雪茄";
    var list = ViewBag.ProductTypeList;
    var productList = ViewBag.productList;
    var kv = ViewBag.kv;
    var PD_TYPE = ViewBag.PD_TYPE;

    var pdtype_name = "";//ViewBag.PD_TYPE_NAME;
    var pdtype_remark = "";//ViewBag.PD_TYPE_REMARK;
    if (productList != null)
    {
        if (productList.Count > 0)
        {
            var t = productList[0];
            pdtype_name = t.PD_TYPE_NAME;
            pdtype_remark = t.PD_TYPE_REMARK;
        }
    }

}
<link href="~/Content/static/css/en.css" rel="stylesheet" />

<section class="secondary-nav mini">
    <div class="secondary-nav-wrapper clearfix show" id="type_wp">

        <ul id="secondary-nav-list">
            @if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    var activeCss = "";
                    if (item.PD_TYPE_URL == PD_TYPE)
                    { activeCss = "active"; }
                    <li class="half @activeCss">
                        <a href="~/Accessories/index/@item.PD_TYPE_URL" onclick="">@item.label</a>
                    </li>
                }
            }
        </ul>
    </div>
</section>

<div class="top-banner">
    <div id="kv_wp">
        <div class="kv" style="position:relative">
            <a href="javascript:void(0)" style="background-image: url(@kv)"><img src="@kv"></a>
        </div>
		<div class="meta">
            <h1 class="title">@pdtype_name</h1>
            <p class="describe">@pdtype_remark</p>
        </div>
    </div>
</div>

<div class="cigars_detailbox ">
    <div class="page_wrapper">
        <section class="row acce_itemsbox">
            @if (productList != null && productList.Count > 0)
            {
                foreach (var item in productList)
                {
                    if (string.IsNullOrEmpty(item.PRODUCT_ID_URL))
                    {
                        item.PRODUCT_ID_URL = item.PRODUCT_ID;
                    }
                    if (item.IMG_URL != null && !string.IsNullOrEmpty(item.IMG_URL) && item.IMG_URL != "[]")
                    {
                        var arr = JsonConvert.DeserializeObject<List<string>>(item.IMG_URL);
                        <a class="item col-sm-12 col-md-6 col-lg-6 col-xl-6" href="/product/detail/@item.PRODUCT_ID_URL">
                            <img src="@arr[0]">
                            <h2 class="title">@item.PRODUCT_NAME</h2>
                            @if (item.IS_NEW == 1)
                            {<div class="icon_new"></div>}
                        </a>
                    }
                }
            }
        </section>
    </div>
</div>
